package chapter_19


class Cell[T](init: T) {
  private[this] var current = init
  def get = current
  def set(x: T): Unit = {
    current = x
  }
}


object Cell {

  def main(args: Array[String]): Unit = {
//    val c1 = new Cell[String]("abc")
//    val c2: Cell[Any] = c1  // 编译不过
//    c2.set(1)
//    val s: String = c1.get
  }
}
